{extend name="public/base"}
{block name="title"}注册 - {$config['title']}{/block}
{block name="toptip"}注册{/block}
{block name="head"}

{/block}
{block name="body"}
<form class="col py-3" action="{:url('/auth/register')}" method="POST">
    {:token_field()}
    {present name="error"}
    <div class="alert alert-danger" role="alert">
        {$error}
    </div>
    {/present}
    <div class="form-group">
        <label>用户名</label>
        <input autofocus type="text" class="form-control" name="name" required placeholder="用户名由 2 到 15 个字符组成">
    </div>
    <div class="form-group">
        <label>电子邮件</label>
        <input type="email" class="form-control" name="mail" required placeholder="正确的邮箱地址可作密码找回">
    </div>
    <div class="form-group">
        <label>密码</label>
        <input type="password" class="form-control" name="password" required placeholder="6-20个字符，区分大小写">
    </div>
    <div class="form-group">
        <label>确认密码</label>
        <input type="password" class="form-control" name="confirm" required placeholder="再次输入密码">
    </div>
    <div class="form-group">
        <label>验证码</label>
        <div class="row no-gutters">
            <input type="text" class="form-control mr-1 mr-md-3" name="captcha" required placeholder="输入验证码" style="flex:1;">
            <div class="col-auto">
                <img style="height:calc(1.5em + .75rem + 2px);" src="{:captcha_src()}" alt="captcha" onclick="this.src=&quot;{:captcha_src()}?&quot;+Math.random();">
            </div>
        </div>
    </div>
    <button type="submit" class="btn btn-primary btn-block">注册</button>
    <a href="{:url('/auth/login')}" class="btn btn-primary btn-block">已有账号？</a>
</form>
{/block}
{block name="foot"}

{/block}